//
//  CaidanView.m
//  Hero
//
//  Created by lanou3g on 16/5/5.
//  Copyright © 2016年 刘永庆. All rights reserved.
//

#import "CaidanView.h"

@interface CaidanView ()
@property (nonatomic, strong) NSArray *array;
@end
@implementation CaidanView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self set_tableView];
        self.array = [NSMutableArray new];
        self.array = @[@"全部",@"上单",@"中单",@"ADC",@"辅助",@"打野"];
        [self registerClass:[UITableViewCell class] forCellReuseIdentifier:@"caidanCell"];
        self.delegate = self;
        self.dataSource = self;
        self.separatorColor = [UIColor redColor];
    }
    return self;
}
- (void)set_tableView
{
    
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.array.count;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
    
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"caidanCell"];
    cell.textLabel.text = self.array[indexPath.row];
    cell.backgroundColor = [UIColor clearColor];

    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [self.myDelegate didSelectCellWith:self.array[indexPath.row]];
}
@end
